@echo off

::http://putty.very.rulez.org/latest/htmldoc/Chapter7.html#plink

call ..\settings_set.bat

set PLINK=c:\bin\putty\plink.exe ^
		-v ^
		-ssh ^
		-pw %PWD% ^
		root@%IP%

echo ==========================================================================
echo executing commands on server

set COMMANDS=^
	"mv /etc/my.cnf.mc++ /etc/my.cnf" ^
	"service mysqld restart" ^
	"cd /home/getafisk" ^
	"chmod 750 *.sh" ^
	"/home/getafisk/mysql_allow_remote_access.sh" ^
	"service mysql restart"


for %%c IN (%COMMANDS%) DO (
	echo .......................................
	echo %%c
	%PLINK%  %%c
)
echo ==========================================================================
echo Press any key (entering reboot)
pause

echo GOING FOR REBOOT
%PLINK%  "reboot"

pause